﻿using System;
using System.Collections.Generic;
using System.Text;

namespace efish.Framework.Model
{
    public class Poll : BaseModel
    {
        public Poll() { }

        public Poll(int id, DateTime addedDate, string addedBy, string questionText,
            bool isCurrent, bool isArchived, DateTime archivedDate, int votes)
        {
            this.AddedDate = addedDate;
            this.AddedBy = addedBy;
            this.QuestionText = questionText;
            this.IsCurrent = isCurrent;
            this.IsArchived = isArchived;
            this.ArchivedDate = archivedDate;
            this.Votes = votes;
        }

        private DateTime _addedDate = DateTime.Now;
        public virtual DateTime AddedDate
        {
            get { return _addedDate; }
            set { _addedDate = value; }
        }

        private string _addedBy = "";
        public virtual string AddedBy
        {
            get { return _addedBy; }
            set { _addedBy = value; }
        }

        private string _questionText = "";
        public virtual string QuestionText
        {
            get { return _questionText; }
            set { _questionText = value; }
        }

        private bool _isCurrent = false;
        public virtual bool IsCurrent
        {
            get { return _isCurrent; }
            set { _isCurrent = value; }
        }

        private bool _isArchived = false;
        public virtual bool IsArchived
        {
            get { return _isArchived; }
            set { _isArchived = value; }
        }

        private DateTime _archivedDate = DateTime.MinValue;
        public virtual DateTime ArchivedDate
        {
            get { return _archivedDate; }
            set { _archivedDate = value; }
        }

        private int _votes = 0;
        public virtual int Votes
        {
            get { return _votes; }
            set { _votes = value; }
        }
    }

    public class PollOption : BaseModel
    {
        public PollOption() { }

        public PollOption(int id, DateTime addedDate, string addedBy, 
            int pollID, string optionText, int votes, double percentage)
        {
            this.ID = id;
            this.AddedDate = addedDate;
            this.AddedBy = addedBy;
            this.PollID = pollID;
            this.OptionText = optionText;
            this.Votes = votes;
            this.Percentage = percentage;
        }

        private DateTime _addedDate = DateTime.Now;
        public virtual DateTime AddedDate
        {
            get { return _addedDate; }
            set { _addedDate = value; }
        }

        private string _addedBy = "";
        public virtual string AddedBy
        {
            get { return _addedBy; }
            set { _addedBy = value; }
        }

        private int _pollID = 0;
        public virtual int PollID
        {
            get { return _pollID; }
            set { _pollID = value; }
        }

        private string _optionText = "";
        public virtual string OptionText
        {
            get { return _optionText; }
            set { _optionText = value; }
        }

        private int _votes = 0;
        public virtual int Votes
        {
            get { return _votes; }
            set { _votes = value; }
        }

        private double _percentage = 0;
        public virtual double Percentage
        {
            get { return _percentage; }
            set { _percentage = value; }
        }
    }
}
